﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
  <head>
    <link rel="stylesheet" href="${ctx}/common/common.css" />
    <title>Title</title>
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all" />
    <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>
  </head>
  <body>
    <form class="layui-form" id="form" action="${ctx}/label/saveLabel">
      <input type="hidden" name="id" id="id" value="${label.id}" />
      <div class="layui-form-item layui-col-md5" style="margin-top: 50px">
        <label class="layui-form-label">申请单号</label>
        <div class="layui-input-block">
          <input
            type="text"
            required
            value="${label.code}"
            readonly="readonly"
            autocomplete="off"
            class="layui-input"
          />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">申请人</label>
        <div class="layui-input-block">
          <input type="text" value="${label.creatorName}" readonly="readonly" autocomplete="off" class="layui-input" />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">申请时间</label>
        <div class="layui-input-block">
          <input type="text" value="
          <fmt:formatDate value="${label.createTime}" pattern="yyyy-MM-dd HH:mm:ss" />
          " readonly="readonly" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">产品名称</label>
        <div class="layui-input-block">
          <input type="text" value="${product.name}" readonly="readonly" autocomplete="off" class="layui-input" />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">规格</label>
        <div class="layui-input-block">
          <input
            type="text"
            value="${product.specifications}"
            readonly="readonly"
            autocomplete="off"
            class="layui-input"
          />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">单位</label>
        <div class="layui-input-block">
          <input type="text" value="${product.unit}" readonly="readonly" autocomplete="off" class="layui-input" />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">生成批次</label>
        <div class="layui-input-block">
          <input type="text" value="${batch.code}" readonly="readonly" autocomplete="off" class="layui-input" />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">生产数量</label>
        <div class="layui-input-block">
          <input type="text" value="${count}" readonly="readonly" autocomplete="off" class="layui-input" />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
          <textarea readonly="readonly" style="width: 100%; height: 100px" class="layui-input" rows="5" cols="5">
${label.remarks}</textarea
          >
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">申请数量</label>
        <div class="layui-input-block">
          <input type="text" value="${label.quantity}" readonly="readonly" autocomplete="off" class="layui-input" />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">
          发放数量
          <span style="color: red">*</span>
        </label>
        <div class="layui-input-block">
          <input
            type="text"
            name="grantQuantity"
            value="${label.grantQuantity}"
            autocomplete="off"
            class="layui-input"
          />
        </div>
      </div>
      <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">审批意见</label>
        <div class="layui-input-block">
          <textarea
            name="content"
            id="content"
            style="width: 100%; height: 100px"
            class="layui-input"
            rows="5"
            cols="5"
          >
${label.content}</textarea
          >
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">审批通过</label>
        <div class="layui-input-block">
          <c:if test="${label.stat==0 }">待审批</c:if>
          <c:if test="${label.stat==1 }">通过</c:if>
          <c:if test="${label.stat==2 }">未通过</c:if>
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="button" id="rollback" class="layui-btn layui-btn-primary">返回</button>
        </div>
      </div>
    </form>
    <script>
      document.getElementById("rollback").addEventListener("click", function () {
        window.history.back();
      });
    </script>
  </body>
</html>
